<?php
namespace app\model;

class User extends BaseModel
{
    // 设置表名
    protected $name = 'users';
    
    // 字段类型转换
    protected $type = [
        'created_at' => 'integer',
        'updated_at' => 'integer',
        'delete_time' => 'integer',
        'is_verified' => 'integer',
        'verification_time' => 'integer'
    ];
    
    // 隐藏字段（仅在输出时隐藏）
    protected $hidden = ['password', 'verification_code'];

    // 允许写入的字段
    protected $allowField = [
        'username',
        'password',
        'email',
        'verification_code',
        'verification_time',
        'is_verified',
        'reminder_key'
    ];

    // 禁用密码字段的任何自动转换
    public function getPasswordAttr($value)
    {
        return $value;
    }

    public function setPasswordAttr($value)
    {
        return $value;
    }
} 